/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2024-03-04
 * Time: 22:53
 */
public class Shape {
    public void draw() {
        System.out.println("画一个圆圈");
    }

    public static void drawMap(Shape shape) {
        shape.draw();
    }


   /* public static void main1(String[] args) {
        *//*drawMap(new Rect());
        drawMap(new Cycle());
        drawMap(new Triangle());*//*

        *//*Shape rect = new Rect();
        Shape triangle = new Triangle();
        Shape cycle = new Cycle();
        Shape[] shapes = {rect,triangle,cycle};
        for(Shape shape:shapes) {
            shape.draw();
        }*//*

        *//*int[] array = {1,2,3,4,5};
        for(int x:array) {
            System.out.print(x + " ");
        }*//*
    }*/
}

class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("画一个矩形");
    }
}

class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("画一个圆圈");
    }
}

class Triangle extends Shape {
    @Override
    public void draw() {
        System.out.println("画一个三角形");
    }
}
